﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link href="../../Scripts/uploadify/uploadify.css" rel="stylesheet" type="text/css" />

    <script src="../../Scripts/uploadify/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="../../Scripts/uploadify/swfobject.js" type="text/javascript"></script>

    <script src="../../Scripts/uploadify/jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>

    <div id="custom-queue">
    </div>
    <div id="imgurls">
    </div>
    <input id="custom_file_upload" type="file" name="Filedata" />

    <script type="text/javascript">
        $(function() {
            $('#custom_file_upload').uploadify({
                'uploader': '../../Scripts/uploadify/uploadify.swf',
                'script': 'http://localhost:4962/Upload/import',
                'cancelImg': '../../Scripts/uploadify/cancel.png',
                'folder': 'uploads',
                'multi': true,
                'auto': true,
                'fileExt': '*.jpg;*.gif;*.png',
                'fileDesc': 'Image Files (.JPG, .GIF, .PNG)',
                'queueID': 'custom-queue',
                'queueSizeLimit': 3,
                'simUploadLimit': 3,
                'removeCompleted': false,
                'onSelectOnce': function(event, data) {
                    $('#status-message').text(data.filesSelected + ' files have been added to the queue.');
                },
                'onAllComplete': function(event, data) {
                    $('#status-message').text(data.filesUploaded + ' files uploaded, ' + data.errors + ' errors.');
                },
                'onComplete': function(event, queueId, fileObj, response, data) {
                    $('#imgurls').append(response + '<br />');
                }
            });
        });
    </script>

</asp:Content>
